import store from "@/store";
import request from "../utils/request";

// 通用
const generalAPI = (path, data) => request.post(path, data);

// 登录
const login = user => request.post("/api/admin/login", user);
const logout = user => request.post("/api/admin/logout", user);

// 微信用户列表
const userList = data => request.get("/api/admin/user", data);
//创建商品
const getgoods = user => request.get("/api/warehouse/good", user)//获取商品信息
const postgoods = user => request.post("/api/warehouse/good", user)//创建商品信息
const putgoods = user => request.put("/api/warehouse/good", user)//修改商品信息
const delgoods = user => request.del("/api/warehouse/good", user)//删除商品信息
const getgamerecord = data => request.get("/api/admin/user/record/purchase/goods", {params:data})//修改无限池赏品信息

//无限赏
const getwuxiangame = user => request.get("/api/wuxianshang/game", user)//获取无限赏信息
const postwuxiangame = user => request.post("/api/wuxianshang/game", user)//创建无限赏信息
const putwuxiangame = user => request.put("/api/wuxianshang/game", user)//修改无限赏信息
const delwuxiangame = user => request.del("/api/wuxianshang/game", user)//删除无限赏信息
const wuxianArgu = user => request.get("/api/wuxianshang/wuxianshangargs") // 查询无限赏全局参数
const addWuxiangood = data => request.post("/api/wuxianshang/gamegood", data) // 无限池添加赏品
const getWuxiangoods = data => request.get("/api/wuxianshang/gamegood", { params: data }) // 获取无限池赏品
const delwuxiangood = data => request.delete("/api/wuxianshang/gamegood", data) // 无限池删除赏品
const wuxianInfo = data => request.get("/api/wuxianshang/game/detail", { params: data }) // 无限池删除赏品

// 全局赏
const getquanjugamegoods = data => request.get("/api/quanjushang/gamegoods", data)//获取全局赏下的盒子
const postquanjugood = data => request.post("/api/quanjushang/good", data) // 添加全局赏品
const getquanjugame = data => request.get("/api/quanjushang/game", data)//获取全局赏池子
const postquanjugame = data => request.post("/api/quanjushang/game", data)//添加全局赏池子
const putquanjugame = data => request.put("/api/quanjushang/game", data)//修改全局赏池子
const getquanjusingle = data => request.get("/api/quanjushang/gameupdate", data)//获取单个池子信息
const putquanjusingle = data => request.put("/api/quanjushang/gameupdate", data)//修改单个池子信息
const putquanjugoods = data => request.put("/api/quanjushang/gamegoods", data) // 修改赏品
const delquanjugoods = data => request.delete("/api/quanjushang/gamegoods", data) // 删除赏品
// 一番赏
const getyifanshang = data => request.get("/api/yifanshang/game", data)// 获取池子列表
const getyifanshangInfo = data => request.get("/api/yifanshang/game/detail", data)// 查询单个池子
const postyifanshang = data => request.post("/api/yifanshang/game", data)// 添加一番赏池子
const putyifanshang = data => request.put("/api/yifanshang/game", data)// 修改一番赏池子
const putyifanshangstate = data => request.put("/api/yifanshang/game/state", data)// 池子上下架
const delyifanshang = data => request.delete("/api/yifanshang/game", data)// 删除一番赏池子
const yifanshangGoods = data => request.get("/api/yifanshang/good", data)// 赏品列表
const addyifanshanggoods = data => request.post("/api/yifanshang/good", data)// 添加一番赏赏品
const delyifangoods = data => request.delete('/api/yifanshang/good', data)//删除一番赏赏品
// 上传图片
const uploadImg = data => request.post("/api/admin/tcb_token", data)//上传
const downloadImg = data => request.post("/api/admin/tcb_download", data)
// 赏品等级设置
const getgoodlevel = data => request.get('/api/warehouse/goodlevel', { params: data })//获取赏品等级
const getgoodlevelInfo = data => request.get('/api/warehouse/goodlevelinfo', data)//获取单个赏品等级
const postgoodlevel = data => request.post('/api/warehouse/goodlevel', data)//创建赏品等级
const putgoodlevel = data => request.put('/api/warehouse/goodlevel', data)//修改赏品等级
const delgoodlevel = data => request.delete('/api/warehouse/goodlevel', data)//删除赏品等级
// 用户
const yingli = data => request.get("/api/admin/user/profit", { params: data }) //用户盈利信息
const expense = data => request.get("/api/admin/user/record/expense", { params: data }) //消费记录
const shanggui = data => request.get("/api/admin/user/packages", { params: data }) //获取赏柜
const daili = data => request.put("/api/admin/user/daili", data) //用户更新代理状态
const jinyong = data => request.put("/api/admin/user/disable", data) //用户更新禁用状态
const shiming = data => request.put("/api/admin/user/real", data) //用户实名认证
const putinvitor = data => request.put("/api/admin/user/inviter", data) //修改推荐人
const choushangJiLu = data => request.get("/api/admin/user/record/raffle", { params: data }) //抽赏记录
const choushangJiLudetail = data => request.get("/api/admin/user/record/raffle/goods", { params: data }) //抽赏记录详情
const tilianJiLu = data => request.get("/api/admin/user/record/refined", { params: data }) //提炼记录
const tilianDetail = data => request.get("/api/admin/user/record/refined/goods", { params: data }) //提炼记录详情
// 排行榜
const chongzhiRank = data => request.get("/api/admin/user/rank/recharge", { params: data }) //充值
const xiaofeiRank = data => request.get("/api/admin/user/rank/consumption", { params: data }) //消费
const yingliRank = data => request.get("/api/admin/user/rank/profit", { params: data }) //盈利
// 财务
const rizhangdan = data => request.get("/api/admin/finance/day", { params: data }) //日账单
const yuezhangdan = data => request.get("/api/admin/finance/month", { params: data }) //月账单
const yuechongzhi = data => request.get("/api/admin/user/record/recharge", { params: data }) //余额充值
const hunjingtixian = data => request.get("/api/admin/user/record/withdraw", { params: data }) //魂晶提现
// 网站设置
const huoquwangzhan = data => request.get("/api/admin/settings/web", { params: data }) //魂晶提现
const putwangzhan = data => request.put("/api/admin/settings/web", data) //魂晶提现

export default {
   daili, yingli, jinyong, shiming, shanggui, putinvitor, expense, choushangJiLu, tilianJiLu, getgamerecord, tilianDetail,
   generalAPI,
   login, logout,
   userList,
   getgoods, postgoods, putgoods, delgoods,
   getwuxiangame, postwuxiangame, putwuxiangame, delwuxiangame, wuxianArgu, addWuxiangood, getWuxiangoods, wuxianInfo, choushangJiLudetail,
   delwuxiangood, getquanjusingle,
   putquanjusingle, getquanjugamegoods, postquanjugood, getquanjugame, postquanjugame, putquanjugame,
   putquanjugoods, delquanjugoods,// 全局赏品
   getyifanshang, getyifanshangInfo, postyifanshang, putyifanshang, delyifanshang, yifanshangGoods,
   putyifanshangstate, addyifanshanggoods, delyifangoods,//一番赏
   uploadImg, downloadImg,
   getgoodlevel, getgoodlevelInfo, postgoodlevel, putgoodlevel, delgoodlevel,//赏品等级
   xiaofeiRank, chongzhiRank, yingliRank,
   rizhangdan, yuezhangdan, yuechongzhi, hunjingtixian, huoquwangzhan, putwangzhan
}